<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp"%>
<html>
<head>
    <meta charset="utf-8" />
    <title>厅干部平时考核管理系统</title>
    <style type="text/css">
        #jedatebox {
            z-index: 9999999999999999999999999999 !important;
        }
        .fc-header td{border: 0!important;}
        .fc-border-separate{border-collapse: collapse!important;}
    </style>

</head>

<body style="background: white!important;">
<div class="njga">
    <div class="njga_rt_main qtry" style="height: 100%;">
        <div class="njga_bottom" style="height: 100%;">
                <div class="njga_bottom_lf" style="padding-right: 0">
                    <div class="njga_bottom_lf_main" id="njga_bottom_lf_main">
                        <!--我的日志-->
                        <div class="njga_bottom_top">
                            <div class="index_jxkh">
                                <div class="index_jxkh_main"
                                     style="width: 100%;height: 100%;float: left;overflow: auto;">
                                    <div class="title">我的日志</div>
                                    <div id="calendar" class="dib"  ></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
    </div>
</div>
<!--日历弹出框-->
<!--日历弹出框结束-->
<!--弹出框-->



<script type="text/javascript">
    function getContentSize() {
        var h = document.documentElement.clientHeight; //clientHeight内容可视区域的高度
        ch = ( h - 44 ) + "px";
        document.getElementById("njga_bottom_lf_main").style.height = ch;
    }
    window.onload = getContentSize; //页面加载时调用getContentSize()
    window.onresize = getContentSize; //当改变窗口大小时会出发getContentSize()
    $(document).ready(function() {

//通知通报月份选择下拉
        $(document).click(function() {
            $(".date_select_xl").slideUp(200);
        });
        $("#date_select").click(function(e) {
            e = e || window.event;
            if(e.stopPropagation) {
                e.stopPropagation();
            } else {
                e.cancelBubble = true;
            }
            $(this).next(".date_select_xl").slideToggle(200);
            var selecttext = $(this).children("p");
            var selectmain = $(this).next(".date_select_xl");
            var lis = selectmain.find('li');
            for(var i = 0; i < lis.length; i++) {
                lis[i].onclick = function() {
                    selectmain.hide();
                    var textval = $(this).html();
                    selecttext.text(decodeURIComponent(textval));
                }
            }
        });
        //通知通报月份选择下拉结束



        var date = new Date();
        var d = date.getDate();
        var m = date.getMonth();
        var y = date.getFullYear();
        $('#calendar').fullCalendar({
            header: {
                left: '',
                center: 'title',
                right: 'prev,next today'
            },
            height:300,
            width:500,
            editable: true,
            events: [],
            dayClick: function(date, allDay, jsEvent, view) {
//
                //考勤记录弹出框
                var workdate = $.fullCalendar.formatDate(date, 'yyyy-MM-dd');
                var open =  layer.open({
                    type: 2,   //0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）。
                    shift: 1,//动画    0-6     css3动画
                    closeBtn: 1,       //关闭按钮  0 不显示  style  1和2  标题为 false 2
                    btn: ['保存', '取消'],
                    btn1: function(index, layero){
                        var newpsw = $(layero).find("iframe")[0].contentWindow;
                        newpsw.submitForm();
                    },
                    title:['我的日志','background:#5f9ad1;color:#fff;text-align: left;font-size: 18px;'],
                    area: ['800px', '100%'], //宽高
                    content:"<c:url value='/worklog/dailyWorkedit.html?workdate='/>"+ workdate +"&type=2"//iframe层-禁滚动条  $("#photosDemo").html()   'http://www.baidu.com/'
                });
            },
            //考勤记录弹出框结束
            loading: function(bool) {
                if(bool)
                    $.loading(true, loading);

                else
                    $.loading(true, loading);
            }
        });

        $.modalOpenDeclare = function(options) {
            var defaults = {
                id: null,
                title: '系统窗口',
                width: "100px",
                height: "100px",
                url: '',
                shade: 0.3,
                btn: ['确认', '关闭'],
                btnclass: ['btn btn-primary', 'btn btn-danger'],
                callBack: null
            };
            var options = $.extend(defaults, options);
            var _width = top.$(window).width() > parseInt(options.width.replace('px', '')) ? options.width : top.$(window).width() + 'px';
            var _height = top.$(window).height() > parseInt(options.height.replace('px', '')) ? options.height : top.$(window).height() + 'px';
            top.layer.open({
                id: options.id,
                type: 2,
                shade: options.shade,
                title: options.title,
                fix: false,
                area: [_width, _height],
                content: options.url,
                btn: options.btn,
                btnclass: options.btnclass,
                yes: function() {
                    options.callBack(options.id);
                },
                cancel: function() {
                    return true;
                },
                end: function() {

                    //alert($("#isreflsh").val());
                    if($("#isreflsh").val() == "1") {
                        //$.reload();
                        var fcsYear = $("#fcs_date_year").val();
                        var fcsMonth = $("#fcs_date_month").val();
                        $("#calendar").fullCalendar('gotoDate', 2000, 0); //刷新
                        $("#calendar").fullCalendar('gotoDate', fcsYear, fcsMonth);
                    }
                    $("#isreflsh").val("0");
                }
            });
        }

        $("#fc-dateSelect").delegate("select", "change", function() {
            var fcsYear = $("#fcs_date_year").val();
            var fcsMonth = $("#fcs_date_month").val();
            $("#calendar").fullCalendar('gotoDate', fcsYear, fcsMonth);
        });

    });
</script>
</body>

</html>